package com.suitsoft.ut.entity.base;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.suitsoft.ut.entity.IdEntity;
import com.suitsoft.ut.entity.account.User;
import com.suitsoft.ut.entity.commons.Examination;
import com.suitsoft.ut.entity.thesis.Thesis;

/**
 * 学生
 *@author Suineg
 */
@Entity
@Table(name = "BD_STUDENT")
public class Student extends IdEntity{
	/** 学院 */
	
	private Discipline discipline;
	
	/** 学院 名 */
	private String college;
	/** 专业 名 */
	private String studentDepartment;
	/** 学生名 */
	private String studentName;
	/** 学生编号  */
	private String studentNo;
	/** 学生入学日期 */
	private Date studentInSchoolDate;
	/** 学生联系电话 */
	private String studentTelephone;
	/** EMAIL */
	private String studentEmail;
	/** 操作人 */
	private User lastUser;
	/** 操作时间 */
	private Date lastDate;
	/** 备注 */
	private String studentMemo;
	/** 班级 */
	private String classes;
	
	/** 账户信息 (即此人对应的账户信息) */
	private User forUser;
	/** 年份 */
	private String year;
	
	/** 已选题目  */
	private Thesis thesis;
	/** 自查表 */
	private Examination examination;
	/** 分组 */
	private Team group;
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "GROUP_ID")
	public Team getGroup() {
		return group;
	}
	public void setGroup(Team group) {
		this.group = group;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name="EXAMINATION")
	public Examination getExamination() {
		return examination;
	}
	public void setExamination(Examination examination) {
		this.examination = examination;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "FOR_USER_ID")
	public User getForUser() {
		return forUser;
	}
	public void setForUser(User forUser) {
		this.forUser = forUser;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "DISCIPLINE_ID")
	public Discipline getDiscipline() {
		return discipline;
	}
	public void setDiscipline(Discipline discipline) {
		this.discipline = discipline;
	}
	public String getStudentName() {
		return studentName;
	}
	public void setStudentName(String studentName) {
		this.studentName = studentName;
	}
	public String getStudentNo() {
		return studentNo;
	}
	public void setStudentNo(String studentNo) {
		this.studentNo = studentNo;
	}
	public Date getStudentInSchoolDate() {
		return studentInSchoolDate;
	}
	public void setStudentInSchoolDate(Date studentInSchoolDate) {
		this.studentInSchoolDate = studentInSchoolDate;
	}
	public String getStudentTelephone() {
		return studentTelephone;
	}
	public void setStudentTelephone(String studentTelephone) {
		this.studentTelephone = studentTelephone;
	}
	public String getStudentEmail() {
		return studentEmail;
	}
	public void setStudentEmail(String studentEmail) {
		this.studentEmail = studentEmail;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_ID")
	public User getLastUser() {
		return lastUser;
	}
	public void setLastUser(User lastUser) {
		this.lastUser = lastUser;
	}
	public Date getLastDate() {
		return lastDate;
	}
	public void setLastDate(Date lastDate) {
		this.lastDate = lastDate;
	}
	public String getStudentMemo() {
		return studentMemo;
	}
	public void setStudentMemo(String studentMemo) {
		this.studentMemo = studentMemo;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "THESIS_ID")
	public Thesis getThesis() {
		return thesis;
	}
	public void setThesis(Thesis thesis) {
		this.thesis = thesis;
	}
	public String getClasses() {
		return classes;
	}
	public void setClasses(String classes) {
		this.classes = classes;
	}
	public String getYear() {
		return year;
	}
	public void setYear(String year) {
		this.year = year;
	}
	
	public void copy(StudentTemp studentTemp){
		this.classes = studentTemp.getClasses();
		this.studentEmail = studentTemp.getEmail();
		this.studentInSchoolDate = studentTemp.getStudentInSchoolDate();
		this.studentMemo = studentTemp.getStudentMemo();
		this.studentName = studentTemp.getName();
		this.studentNo = studentTemp.getNo();
		this.studentTelephone = studentTemp.getTelephone();
		this.studentDepartment = studentTemp.getDepartment();
		this.college = studentTemp.getCollege();
	}
	public String getCollege() {
		return college;
	}
	public void setCollege(String college) {
		this.college = college;
	}
	public String getStudentDepartment() {
		return studentDepartment;
	}
	public void setStudentDepartment(String studentDepartment) {
		this.studentDepartment = studentDepartment;
	}
}

